
package service.impl;

import dao.DaoException;
import dao.UserDao;
import model.Users;
import service.ServiceException;
import service.UserService;

public class UserServiceImpl implements UserService{
	private UserDao userDao;

	public UserDao getUserDao() {
		return userDao;
	}

	public void setUserDao(UserDao userDao) {
		this.userDao = userDao;
	}

	@Override
	public Users getUserByUsername(String username) throws ServiceException {
		 try {
	            return userDao.getUserByUsername(username);
	        } catch (DaoException e) {
	            throw new ServiceException(e.getMessage(), e);
	        }
	}

	@Override
	public boolean verifyPassword(Users user, String password) {
		return user.getParola().equals(password);
	}

}
